class Api::LibraryController < ApplicationController
  def borrowlist
    if params[:document_id] != nil
      @result = LibraryBorrowRecord.joins(:student,:library_document).where('library_borrow_records.library_document_id = ' + params[:document_id].to_s).page(params[:page]).per(15)
      respond_to do |format|
        #format.html # index.html.erb
        format.xml  { render :xml => @result }
        format.json { render :json => @result }
      end
    end
  end
end
